<project name="StockholmsStad" default="Info">
	<include buildfile="properties.include" />
	
  <target name="Run" description="Run the targets">
    <call target="Common" />
    <call target="Build" />
  </target>
  
  <target name="Test" description="Run the targets for test">
    <call target="Common" />
    <call target="BuildTest" />
  </target>

  <target name="Common" description="Common for all targets">
    <call target="CleanDeployFolder" />
    <call target="GetLatest" />
    <call target="CopyDBFiles" />
  </target>

  <target name="DBSetup" description="Run the targets">
    <call target="CleanDeployFolder" />
    <nant buildfile="${Global.CoreTargetsBuildFile}" target="Core.GetDBFilesTrunk" inheritall="true"/>
    <call target="CopyDBFiles" />
  </target>

  <target name="CleanDeployFolder" description="Cleaning deployfolder">
    <nant buildfile="${Global.CoreTargetsBuildFile}" target="Core.CleanDeployFolder" inheritall="true"/>
  </target>

  <target name="GetLatest" description="Getting latest from Subversion">
    <nant buildfile="${Global.CoreTargetsBuildFile}" target="Core.GetLatest" inheritall="true"/>
  </target>

  <target name="Build" description="Building Parvis">
    <echo message="Building targets" />
    <nant buildfile="${Global.SrcFolder}\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Windows.UI\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Web.UI\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.DataBase.Procedures.Setup\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.WindowsService.Setup\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Reports\build.xml" target="Run" inheritall="true"/>
  </target>
  
  <target name="BuildTest" description="Building ParvisTest">
    <echo message="Building targets for Test" />
    <nant buildfile="${Global.SrcFolder}\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Setup\StockholmsStad.Windows.UI.Test.Setup\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Web.UI\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Setup\StockholmsStad.DataBase.Procedures.Test.Setup\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Setup\StockholmsStad.WindowsServiceTest.Setup\build.xml" target="Run" inheritall="true"/>
    <nant buildfile="${Global.SrcFolder}\StockholmsStad.Reports\build.xml" target="Run" inheritall="true"/>
  </target>
  
  <target name="CopyDBFiles">
    <nant buildfile="${Global.CoreTargetsBuildFile}" target="Core.CopyDBScripts" inheritall="true"/>
  </target>

</project>